{% extends 'base_mian.html' %}

{% load static %}

{% block ext_css %}
    {{ block.super }}
    <link rel="stylesheet" href="{% static 'axf/main/market/css/market.css' %}">
{% endblock %}

{% block ext_js %}
    {{ block.super }}
    <script type="text/javascript" src="{% static 'axf/main/market/js/market.js' %}"></script>
{% endblock %}
{% block content %}
    {{ block.super }}
    <div id="market">
{#    左边导航#}
        <aside>
            <ul>
                {% for axfoodtype in axfoodtypes %}
                    <li>
                        {% if axfoodtype.typeid == typeid %}
                                <span class="yellowSlide"></span>
                        {% endif %} 

                        <a href="{% url 'axfmarket:market' %}?typeid={{ axfoodtype.typeid }}">{{ axfoodtype.typename }}</a>
                    </li>
                {% endfor %}
            </ul>
        </aside>
{#    右上#}
        <nav>
            <ul>
                <li>
                    <span id="all_type">
                        全部分类
                        <span class="glyphicon glyphicon-chevron-down"></span>
                    </span>
                </li>
                <li>
                    <span id="sort_rule">
                        综合排序
                        <span class="glyphicon glyphicon-chevron-down"></span>
                    </span>
                </li>
            </ul>
        </nav>

{# 商品展示#}
        <div>
            <section>
                <menu>
                    <ul>
                        {% for good in good_list %}
                            <li>
                                <a href="">
                                    <img src="/static{{ good.productimg }}" alt="">
                                    <span class="shoppingInfo">
                                        <h6>{{good.productlongname}}</h6>
                                        <p class="detailTag">
                                            <span>精选</span>
                                            <span></span>
                                        </p>
                                        <span class="unit">{{good.specifics}}</span>
                                        <p class="price">
                                            <span>￥{{ good.price }}</span>
                                            <s>￥{{ good.marketprice }}</s>
                                        </p>



                                     </span>
                                </a>
                                <section>
                                    <button>-</button>
                                    <span>0</span>
                                    <button>+</button>
                                </section>

                            </li>

                        {% endfor %}


                    </ul>
                </menu>
            </section>
        </div>
{#    分类#}
        <section>
            <menu>
                <div hidden="hidden" id="all_type_container">
                    <div>
                        {% for c in c_list %}
                            <a href="{% url 'axfmarket:market' %}?typeid={{ typeid }}&childcid={{ c.1 }}&s_rule={{ s_rule }}">
                                {% if c.1 == childcid %}
                                    <span style="background-color: #4cae4c">{{c.0}}</span>
                                    {% else %}
                                    <span>{{ c.0 }}</span>
                                {% endif %}

                            </a>
                        {% endfor %}


                    </div>
                </div>

                <div hidden="hidden" id="sort_type_container">
                    <div>
                        {% for sort_rule in sort_rule_list %}
                            <a href="{% url 'axfmarket:market' %}?s_rule={{ sort_rule.1 }}&typeid={{ typeid }}&childcid={{ childcid }}">
                                {% if sort_rule.1 == s_rule %}
                                    <span style="background-color: #4cae4c">{{ sort_rule.0 }}</span>
                                    {% else %}
                                    <span>{{ sort_rule.0 }}</span>
                                {% endif %}

                            </a>
                        {% endfor %}
                    </div>
                </div>
            </menu>
        </section>

    </div>
{% endblock %}